#ifndef QUINCEAPPLICATION_H
#define QUINCEAPPLICATION_H

class MessageDispatcher;
class SketchDocument;

class QuinceApplication : public QApplication
{
public:
    QuinceApplication(int argc, char **argv);
    virtual ~QuinceApplication();

    static QuinceApplication *instance();

    virtual void addDocument(SketchDocument * doc);
    virtual void removeDocument(SketchDocument * doc);

    virtual MessageDispatcher & localDispatcher() const;

private:
    Q_DISABLE_COPY(QuinceApplication)


    std::auto_ptr<MessageDispatcher> mMsgDispatcher;
    typedef list<SketchDocument* > DocumentList;
    DocumentList mDocuments;

    static QuinceApplication *self;
};

inline QuinceApplication &
QuinceApp() {
    assert(QuinceApplication::instance() != NULL);
    return *QuinceApplication::instance();
}

#endif // QUINCEAPPLICATION_H
